package redis.case2;

import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
 
public interface DistributedLocker {
 
    RLock lock(String lockKey);
 
    RLock lock(String lockKey, long timeout);
 
    RLock lock(String lockKey, TimeUnit unit, long timeout);
 
    boolean tryLock(String lockKey, TimeUnit unit, long waitTime, long leaseTime);
 
    void unlock(String lockKey);
 
    void unlock(RLock lock);

    Future tryLockAsync(String lockKey,long waitTime, long leaseTime);
}
